import java.util.ArrayList;
import java.util.Random;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ArrayList<Thread> array = new ArrayList<Thread>();
		Random rm = new Random();
		for (int i = 0; i < 20; i++) {
			MyRuneable r1 = new MyRuneable();
			Thread h1 = new Thread(r1);
			h1.setPriority((rm.nextInt(1) * 2) + 6);
			r1.setPrioridad(h1.getPriority());
			array.add(h1);
		}
		for (int i = 0; i < array.size();i++){
		 Thread aux = array.get(i);
		 aux.start();
		}
		
	}

}
